Skip to content

SNOW-3385961: improve INFER_SCHEMA zero-row FileNotFoundError message#4201

Open
sfc-gh-fhe wants to merge 3 commits intomainfrom
fhe-SNOW-3385961-infer-schema-zero-row-message
Open

SNOW-3385961: improve INFER_SCHEMA zero-row FileNotFoundError message#4201
sfc-gh-fhe wants to merge 3 commits intomainfrom
fhe-SNOW-3385961-infer-schema-zero-row-message

Conversation

@sfc-gh-fhe
Copy link
Copy Markdown
Contributor

@sfc-gh-fhe sfc-gh-fhe commented Apr 27, 2026

  1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-NNNNNNN

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
      • If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
    • If this is a new feature/behavior, I'm adding the Local Testing parity changes.
    • I acknowledge that I have ensured my changes to be thread-safe. Follow the link for more information: Thread-safe Developer Guidelines
    • If adding any arguments to public Snowpark APIs or creating new public Snowpark APIs, I acknowledge that I have ensured my changes include AST support. Follow the link for more information: AST Support Guidelines
  3. Please describe how your code solves the related issue.

    Please write a short description of how your code change solves the related issue.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 27, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@sfc-gh-fhe sfc-gh-fhe changed the title Fhe snow 3385961 infer schema zero row message SNOW-3385961: infer schema zero row message Apr 27, 2026
@sfc-gh-fhe sfc-gh-fhe changed the title SNOW-3385961: infer schema zero row message SNOW-3385961: improve INFER_SCHEMA zero-row FileNotFoundError message Apr 27, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.42%. Comparing base (c3cc950) to head (e5a0dee).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4201      +/-   ##
==========================================
+ Coverage   95.10%   95.42%   +0.31%     
==========================================
  Files         171      171              
  Lines       43840    43842       +2     
  Branches     7517     7517              
==========================================
+ Hits        41696    41835     +139     
+ Misses       1334     1226     -108     
+ Partials      810      781      -29     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sfc-gh-fhe
Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

When INFER_SCHEMA returns zero rows, the reader used to raise:

    FileNotFoundError: Given path: '{path}' could not be found or is empty.

Zero rows can also mean file-format options silently filtered every
row/header (e.g. PARSE_HEADER on a file with a leading blank line,
SKIP_HEADER exceeding row count, or ON_ERROR=CONTINUE dropping bad
rows). The old message sends users chasing a path-not-found issue
that isn't real.

Keep the exception type (FileNotFoundError) for back-compat, but
rewrite the message to surface both possibilities and append any
applied PARSE_HEADER / SKIP_HEADER / ON_ERROR values that are already
in scope (no extra round-trip).

Update the existing integ assertions in test_filepath_not_exist_or_empty
to match the new wording and to access the message via str(ex_info.value)
so the full (longer) message is compared.
Trim the multi-line comment to a single 3-line note, replace the manual
option-hint loop with a list comprehension, and shorten the error
message without losing the "path missing or format-option-filtered"
information.
@sfc-gh-fhe sfc-gh-fhe force-pushed the fhe-SNOW-3385961-infer-schema-zero-row-message branch from 1d2543f to e5a0dee Compare April 29, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants